package com.ebt.m.widget.image_chooser;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;

import java.util.ArrayList;

public class ImagePagerAdapter extends FragmentStatePagerAdapter {
	private ArrayList<String> urls;

	public ImagePagerAdapter(FragmentManager fm, ArrayList<String> urls) {
		super(fm);
		this.urls = urls;
		if (this.urls == null) {
			this.urls = new ArrayList<String>();
		}
	}

	@Override
	public int getCount() {
		return urls.size();
	}

	@Override
	public Fragment getItem(int position) {
		return ImageChooserLocalImageDetail.newInstance(urls.get(position), false);
	}

	@Override
	public void destroyItem(ViewGroup container, int position, Object object) {
		super.destroyItem(container, position, object);
	}

}